import numpy as np

import matplotlib.pyplot as plt






y=[9.1,18.3,32,47,69.5,94.8]

#phi=zip(z,x,y)

x_in=float(input())



def phiCal(x,n):
    lst=[]
    for i in x:
        lst.append(i**n)
    return lst

x1=[1,2,3,4,5,6]
x0=phiCal(x1,0)
x2=phiCal(x1,2)

x=(x0,x1,x2)

# print(x2)

def itemCal(lst1,lst2):
    sum=0
    for i,j in zip(lst1,lst2):
        sum+=i*j
    return sum

A=np.zeros(shape=(3,3))
for i in range(3):
    for j in range(3):
        A[i,j]=itemCal(x[j],x[i])

b=[itemCal(y,x0),itemCal(y,x1),itemCal(y,x2)]

a=np.linalg.solve(A, b)

print("%.4f"%(a[0]+a[1]*x_in+a[2]*x_in*x_in))

plt.plot(x1,y)
plt.show()

